﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Zennect.IPC.Jabber;

namespace Test___Zennect.IPC.Jabber {
	[TestClass]
	public class JabberIPC_Test {
		public TestContext TestContext { get; set; }
		public JabberIPC m_client;

		//[ClassInitialize]
		//public static void Initialize(TestContext testContext) { 
		//}

		//[ClassCleanup]
		//public static void Cleanup() { 
		//}

		[TestInitialize]
		public void Initialize() {
			m_client = new JabberIPC("li5-52.members.linode.com", "scmccart_test", "xiqt0n789");
		}

		[TestCleanup]
		public void Cleanup() { 
		}

		const string debugAccount = "scmccart_debug@li5-52.members.linode.com";

		[TestMethod]
		public void SendOneWayInt() {
			m_client.SendOneWayMessage(debugAccount, 123);
		}

		[TestMethod]
		public void SendInt() {

		}

		[TestMethod]
		public void SendOneWayArrayOfInt() {
			m_client.SendOneWayMessage(debugAccount, new int[] { 1, 2, 3 });
		}

		[TestMethod]
		public void SendArrayOfInt() {

		}

		[TestMethod]
		public void SendOneWayStruct() {
			var ts = new TestStruct() { One = "One", Two = 2 };
			m_client.SendOneWayMessage(debugAccount, ts);
		}

		[TestMethod]
		public void SendStruct() {

		}

		struct TestStruct {
			public string One { get; set; }
			public int Two { get; set; }
		}

		[TestMethod]
		public void SendOneWayClass() {
			var tc = new TestClass() { A = "A", B = 1 };
			m_client.SendOneWayMessage(debugAccount, tc);
		}

		[TestMethod]
		public void SendClass() {

		}

		class TestClass {
			public string A { get; set; }
			public int B { get; set; }
		}
	}
}
